<template>
  <div>
    <div v-if="this.datList == ''">
      <img
        src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3214428190,3968304704&fm=26&gp=0.jpg"
        alt=""
      />
      <h2>暂时没货哦</h2>
    </div>

    <div v-else>
      <div
        v-for="(item, index) in datList"
        :key="index"
        class="item_class_image"
      >
        <img :src="item.pic" alt="" />
      </div>
    </div>
  </div>
</template>

<script>

export default {
  data() {
    return {
      datList: [],
    };
  },

  mounted() {
    var id = this.$route.query.id;

    this.$APIShow.classify().then((res) => {
      console.log(res);
      res.data.data.map((item) => {
        if (item.categoryId == id) {
          this.datList.push(item);
        }
      });
    });
  },
};
</script>

<style scoped>
img {
  width: 100%;
  height: 300px;
}

h2 {
  text-align: center;
}

.item_class_image {
  margin-top: 64px;
}

.item_class_image img {
  width: 200px;
  height: 200px;
}
</style>